package com.engine4cloud.tdf.supervision.feign;

import com.engine4cloud.tdf.common.core.constant.SecurityConstants;
import com.engine4cloud.tdf.common.core.constant.ServiceNameConstants;
import com.engine4cloud.tdf.common.core.util.R;
import com.engine4cloud.tdf.common.data.web.response.PageInfo;
import com.engine4cloud.tdf.common.data.web.response.Params;
import com.engine4cloud.tdf.supervision.dto.create.SpHelpCreateDTO;
import com.engine4cloud.tdf.supervision.dto.query.SpHelpQueryDTO;
import com.engine4cloud.tdf.supervision.dto.result.SpHelpResultDTO;
import com.engine4cloud.tdf.supervision.dto.update.SpHelpUpdateDTO;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * 审批-帮扶申请
 *
 * @author sh
 * @date 2024-08-02 15:07:07
 */
@FeignClient(contextId = "RemoteSpHelpService", value = ServiceNameConstants.SUPERVISION_SERVER)
public interface RemoteSpHelpService {

    /**
     * 分页查询
     *
     * @param page 分页对象
     * @param dto  帮扶申请
     * @return R<PageInfo < RcglHelpResultDTO>>
     */
    @GetMapping("/inner/help/page")
    R<PageInfo<SpHelpResultDTO>> getPageList(@RequestParam("page") Params page, @Valid @RequestParam("dto") SpHelpQueryDTO dto,
                                             @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 通过id查询帮扶申请
     *
     * @param id id
     * @return R
     */
    @GetMapping("/inner/help/{id}")
    R<SpHelpResultDTO> getById(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 新增帮扶申请
     *
     * @param dto 帮扶申请
     * @return R
     */
    @PostMapping("/inner/help")
    R<Boolean> create(@Valid @RequestBody SpHelpCreateDTO dto, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 修改帮扶申请
     *
     * @param dto 帮扶申请
     * @return R
     */
    @PutMapping("/inner/help")
    R<Boolean> update(@Valid @RequestBody SpHelpUpdateDTO dto, @RequestHeader(SecurityConstants.FROM) String from);
}
